import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime' // import plugin
import 'dayjs/locale/zh-cn' // import locale
dayjs.extend(relativeTime) // use plugin
dayjs.locale('zh-cn') // use locale

export const timeTo = (dateStr) => dayjs().to(dayjs(dateStr))
